/***********************************************
 * Title:       IbatisClassDao.java
 * Description: TODO ADD DISCRIPTION TO IbatisClassDao.java
 * Author:      Administrator
 * Create Date: 2009-12-20
 * CopyRight:   CopyRight(c)@2009
 * Version:     1.0
 ***********************************************
 */

package edu.tju.classes;

import java.sql.SQLException;


import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import com.younker.waf.db.IBatisConfig;



/**
 * @author LeiKang
 *
 */
public class IbatisAdvisorHistoryDao implements IAdvisorHistoryDao{
	
	protected SqlMapClient sqlMap = IBatisConfig.getSqlMapInstance();	 
	 


	/* (non-Javadoc)
	 * @see edu.tju.classes.ITheClassDao#deleteTheClass(long)
	 */
	public void deleteAdvisorHistory(long id) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see edu.tju.classes.ITheClassDao#getTheClassAnd(edu.tju.model.TheClass)
	 */
	@SuppressWarnings("unchecked")
	public List<AdvisorHistory> getAdvisorHistoryAnd(AdvisorHistory advisorHistory) throws SQLException {
		
		return sqlMap.queryForList("getAdvisorHistoryAnd", advisorHistory);
		
	}


	/* (non-Javadoc)
	 * @see edu.tju.classes.ITheClassDao#getTheClassById(long)
	 */
	public AdvisorHistory getAdvisorHistoryById(long id) throws SQLException {
	
		 return (AdvisorHistory) sqlMap.queryForObject("getAdvisorHistoryById", id);
		 
	}


	/* (non-Javadoc)
	 * @see edu.tju.classes.ITheClassDao#getTheClassOr(edu.tju.model.TheClass)
	 */
	public List<AdvisorHistory> getAdvisorHistoryOr(AdvisorHistory advisorHistory) throws SQLException {
		// TODO Auto-generated method stub
		return null;
		
	}


	/* (non-Javadoc)
	 * @see edu.tju.classes.ITheClassDao#insertTheClass(edu.tju.model.TheClass)
	 */
	public Long insertAdvisorHistory(AdvisorHistory advisorHistory) throws SQLException {
		
		return  (Long)sqlMap.insert("insertAdvisorHistory", advisorHistory); 
		
	}


	/* (non-Javadoc)
	 * @see edu.tju.classes.ITheClassDao#updateTheClass(edu.tju.model.TheClass)
	 */
	public int updateAdvisorHistory(AdvisorHistory advisorHistory) throws SQLException {
		
		 return sqlMap.update("updateAdvisorHistory", advisorHistory);
		
	}
       
}
